// =========================================================================
// Created by NYIDE.
// User: Administrator
// Date: 3/22/2022
// Description:
// =========================================================================
	
	
#ifndef COLOR_H
#define COLOR_H
#define uint8 unsigned char

struct ColorTemp_t {
	uint8 warm;
	uint8 cold;
	uint8 brightness;
};
struct ColorRGB_t {
	uint8 red;
	uint8 green;
	uint8 blue;
	uint8 brightness;
};


typedef struct Color_stuct {
	uint8 mode;
	union ColorType {
		struct ColorTemp_t colorTemp;
		struct ColorRGB_t colorRGB;
	}color;
}Color_t;


#define PWM_STATE_MIX_100 1
#define PWM_STATE_MIX 2
#define PWM_STATE_WARM_ONLY 3
#define PWM_STATE_COLD_ONLY 4

#define COLOR_MODE_COLORTEMP 0
#define COLOR_MODE_COLORRGB 1
#define COLOR_MODE_FLASH 2
#define COLOR_MODE_SMOTH 3

#define SAVE_PERSONAL_MODE 0x08
#define SAVE_PERSONAL_COLOR_TEMP_WARM 0x02
#define SAVE_PERSONAL_COLOR_TEMP_COLD 0x03
#define SAVE_PERSONAL_COLOR_RGB_RED 0x04
#define SAVE_PERSONAL_COLOR_RGB_GREEN 0x05
#define SAVE_PERSONAL_COLOR_RGB_BLUE 0x06
#define SAVE_PERSONAL_COLOR_BRIGHTNESS 0x07

void initColor(void);
void updateColor(void);
void colorHandler(void);
void writeColor(void);

#endif /* end of include guard: file1_H */